# -*- coding: utf-8 -*-
"""
@Author: Logan
@Date:   2025/6/30 17:40
@Description: 
"""

from base.LeftMenuBase import LeftMenuBase
from selenium.webdriver.common.by import By
from base.ObjectMap import ObjectMap


class LeftMenuPage(LeftMenuBase, ObjectMap):

    def click_level_one_menu(self, driver, menu_name):
        """
        点击一级菜单
        :param driver:
        :param menu_name: 菜单名
        :return:
        """
        menu_xpath = self.level_one_menu(menu_name)
        return self.element_click(driver,By.XPATH, menu_xpath)

    def click_level_two_menu(self, driver, menu_name):
        """
        点击二级菜单
        :param driver:
        :param menu_name: 二级菜单名
        :return:
        """
        menu_xpath = self.level_two_menu(menu_name)
        return self.element_click(driver,By.XPATH, menu_xpath)
